<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="../css/index.css"/>		
		<script src="../js/ajax.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/vant.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="html5plus://ready"></script>
		<script src="../js/back.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<style type="text/css">
		#img{
			height: 170px;
			width: 100%;
		}
		#imgtext{
			margin-top: -65px;
			color: white;
			margin-left: 50px;
		}
		#imgtext2{
			margin-top: -111px;
			color: white;
			margin-left: 25px;
			
			font-size: 20px;
		}
		#shdz{			
			margin-top: 60px;
			padding: 10px;
		}		
		#font{
			font-size: 17px;
			color: red;
		}
		#dz-img{
			margin-top: 10px;
			width: 50px;
			height: 50px;
			border-radius: 25px;
		}
	</style>
	<body>
		<div id="app">
			<div id="">
				<img src="../img/IMG_20190422_164609.jpg"  id="img">
				<div id="imgtext">√支付成功</div>
				<div id="imgtext2" @click="back"><返回</div>	
			</div>
			<div id="shdz">
				<van-row id="shdz"><!-- 收货地址开始 -->
					<van-col span="4" >
						<img src="../img/u=1961861013,358764824&fm=26&gp=0.jpg" id="dz-img">
					</van-col>	
					<van-col span="20" >
						<div style="margin-bottom: 5px;">
							<van-row>
								<van-col span="6">
									<span >{{shname}}</span>
								</van-col>
								<van-col span="6" style="margin-top: 1px;">
									<span >{{phone}}</span>
								</van-col>								
							</van-row>
						</div>
						<div>
							<span >{{shdz}}</span>
						</div>
					</van-col>										
				</van-row><!-- 收货地址结束 -->
			</div>			
			<div id="card">
				<van-card
					v-bind:price="price" 
					v-bind:title="name"							 
					v-bind:thumb="GoodsImageUrl"
					v-bind:num="count"	
					centered=true
					v-bind:id="id">
					<img v-bind:src="GoodsImageUrl" 
					onerror="javascript:this.src='../img/product_default.jpg';onerror=null; "  
					slot="thumb">
					<div slot="footer">
						<van-button size="small" round @click="order">查看订单</van-button>						
					</div>								
				</van-card> 
			</div>
			<div id="">
				<van-cell-group>
					<van-cell title="商品价格" :value="price"></van-cell>					
				</van-cell-group>
				<van-cell-group>
					<van-cell title="购买数量" :value="count"></van-cell>					
				</van-cell-group>
				<van-cell-group>
					<van-cell title="实付款" :value="payprice" id="font"></van-cell>					
				</van-cell-group>
				 
			</div>
			
		</div>
		<script type="text/javascript">
			var vm=new Vue({
				el:"#app",
				data:{
					count:localStorage.getItem("spshuliang"),		//商品卡片数量					
					price:localStorage.getItem("goumaiprice"),		//商品卡片价格					
					name:localStorage.getItem("spname"),		//商品卡片名称
					list:[],
					GoodsImageUrl:"",		//商品卡片图片
					id:localStorage.getItem("payid"),		//商品卡片id
					payprice:"￥:"+localStorage.getItem("spshuliang")*localStorage.getItem("goumaiprice"),
					shdz:"",		//收货地址
					shname:"",		//商品名称
					phone:"",		//手机号
				},
				methods:{
					back(){
						var arr=plus.webview.currentWebview();
						plus.webview.close(arr,"slide-out-right")
					},
					order(){
						plus.webview.create("../presoanl/order.html","order");
						plus.webview.show("order")
					}
				},
				mounted(){
					ajax({
						url: "http://dsapi.ysd3g.com/api/MyDefaultAddress",
						data:{
							key:localStorage.getItem("keys")
						},
						dataType: "jsonp",
						success:function(res){
							if(res.Error==false){								
								vm.shdz=res.address;
								vm.shname=res.name;
								vm.phone=res.tel;
							}else{
								plus.webview.currentWebview().reload();
							}							
						}
					})
				}
			})
		</script>
	</body>
</html>
